#pragma once

#include "Types.h"

namespace Vortex { namespace Wrapper { namespace Direct3D {

	///<summary>Represents D3DXVERTEXELEMENT9 structure for describing </summary>
	[System::Runtime::InteropServices::StructLayout(System::Runtime::InteropServices::LayoutKind::Sequential)]
	public value struct D3DVertexElement {
		WORD Stream;
		WORD Offset;
		D3DDeclType Type;
		D3DDeclMethod Method;
		D3DDeclUsage Usage;
		BYTE UsageIndex;

		D3DVertexElement(WORD stream, WORD offset, D3DDeclType type, D3DDeclMethod method, D3DDeclUsage usage, BYTE usageIndex) {
			Stream = stream;
			Offset = offset;
			Type = type;
			Method = method;
			Usage = usage;
			UsageIndex = usageIndex;
		}

		D3DVertexElement(WORD offset, D3DDeclType type, D3DDeclUsage usage, BYTE usageIndex) {
			Stream = 0;
			Offset = offset;
			Type = type;
			Method = D3DDeclMethod::Default;
			Usage = usage;
			UsageIndex = usageIndex;
		}

		D3DVertexElement(WORD offset, D3DDeclType type, D3DDeclUsage usage) {
			Stream = 0;
			Offset = offset;
			Type = type;
			Method = D3DDeclMethod::Default;
			Usage = usage;
			UsageIndex = 0;
		}

		///<summary>Terminating vertex element</summary>
		static initonly D3DVertexElement End = D3DVertexElement(0xFF, 0, D3DDeclType::Unused, D3DDeclMethod::Default, D3DDeclUsage::Position, 0);
	};

} } }